/**
 * 预订须知
 * @constructor
 */
function Editingyd() {
}

Editingyd.init = function () {
    //开启富文本编辑器
    $(document).ready(function(){
        $('.summernote').summernote();
        //为富文本编辑器赋值
        $.ajax({
            url:"/aboutus/ydshow",
            type:"get",
            contentType:"application/json",
            dataType:"json",
            success:function(data){
                console.log("data",data)
                $('.summernote').code(data.content);
            }
        });
    });
}
//提交富文本
function submit(){
    let content = $('.summernote').code();
    let pm = {
        aboutID:1,
        content:content
    }
    $.ajax({
        url:"/aboutus/ydsave",
        type:"post",
        data:JSON.stringify(pm),
        contentType:"application/json",
        dataType:"json",
        success:function(data){
            if (data.code === "200") {
                swal("操作成功!", "请继续操作", "success");
            } else {
                swal("操作失败!", "请重试", "error");
            }
        }
    });
}
//*****************************************************************************************